src = $(wildcard src/*.java)
cls = $(src:.java=.class)
jar = dndcharc.jar

JAR = jar
JAVAC = javac
JFLAGS = -g

$(jar): $(cls)
	$(JAR) cfe $@ Charsheet -C src $(subst src/,,$(cls))
	chmod +x $@

%.class: %.java
	$(JAVAC) $(JFLAGS) $<

.PHONY: clean
clean:
	rm -f *.class
